<template>
  <div>
    <div>
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
        <el-form-item label="客户订单号">
          <el-input v-model="formInline.orderId"></el-input>
        </el-form-item>
        <el-form-item label="客户名称">
          <el-input v-model="formInline.username"></el-input>
        </el-form-item>
        <!--        <el-form-item label="签收日期">-->
        <!--          <el-date-picker-->
        <!--            v-model="formInline.receiptDate"-->
        <!--            type="datetimerange"-->
        <!--            range-separator="至"-->
        <!--            start-placeholder="开始日期"-->
        <!--            end-placeholder="结束日期">-->
        <!--          </el-date-picker>-->
        <!--        </el-form-item>-->
        <el-form-item>
          <el-button type="primary" @click="findall">查询</el-button>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="reset">重置</el-button>
        </el-form-item>
      </el-form>
    </div>


    <!--    按钮功能-->
    <div>
      <el-button type="info" @click="exp">导出</el-button>
<!--      <el-button @click="exportExcel" type="primary" >导出</el-button>-->
      <router-link to = "/home/FinancialHome">
        <el-button type="primary"  >返回</el-button>
      </router-link>
    </div>

    <br>
    <br>

    <!--主页面展示-->
    <template>
      <el-table
        :data="tableData"
        border
        style="width: 100%"
        @selection-change="handleSelectionChange">
        <el-table-column
          type="selection"
          width="55">
        </el-table-column>
        <el-table-column
          prop="torderId.orderId"
          label="订单编号"
          width="150"
          align="center">
        </el-table-column>
        <el-table-column
          prop="torderId.username"
          label="客户名称"
          width="280"
          align="center">
        </el-table-column>
        <el-table-column
          prop="torderId.orderTime"
          label="创建时间"
          width="280"
          align="center">
        </el-table-column>
        <el-table-column
          prop="transport.number"
          label="订单数量"
          width="280"
          align="center">
        </el-table-column>
        <el-table-column
          prop="tcostId.totalCost"
          label="应收总计"
          width="230"
          align="center">
        </el-table-column>

      </el-table>
    </template>




  </div>
</template>

<script>
export default {
  name: "receivable",
  data(){
    return{
      //主页面展示
      tableData: [],
      radio: '1',
      Data:[],
      //查询
      formInline: {
        orderId: '',
        username:'',
      },

      multipleSelection: [],
    }
  },
  methods: {
    exp(){
      window.open("http://localhost:8090/tFinance/export")
    },
    handleSelectionChange(val){
      this.multipleSelection = val;
    },
    // 页面大小的触发函数
    //重置
    reset(){
      this.formInline.orderId = null,
        this.formInline.username = null,
        this.findall()
    },

    //页面展示
    findall() {
      this.$http({
        method: "GET",
        url: "http://localhost:8090/tFinance/ts",
        params: {
          currentPage: this.currentPage,
          pageSize: this.pageSize,
          orderId: this.formInline.orderId,
          username: this.formInline.username,
        }
      }).then(resp => {
        console.log("通知")
        console.log(resp)
        console.log(resp.data.data)
        this.tableData = resp.data,
          this.total = resp.data.total;
      })

    },
  },
  // handleClose(done) {
  //   this.$confirm('确认关闭？')
  //     .then(_ => {
  //       done();
  //     })
  //     .catch(_ => {});
  // },
  created() {
    this.findall();
  },

}
</script>

<style scoped>

</style>
